var visible = false;

function move_it()
{
	if (document.layers)
	{		
		this.captureEvents(Event.MOUSEMOVE);
		this.onmousemove = pos;
	}
	else
	{  		
		pos(0);	
	}
}

function pos(ev)
{
	if (document.layers)
	{		
		setPos(ev.pageX - 0, ev.pageY);
		this.routeEvent(ev);
	}
	else
	{ 		
		if (document.all)
		{
			setPos(event.clientX - 0, event.clientY + 10);			
		}			
	}
}

function setPos(x,y)
{
	if (visible)
	{
		if (document.all)
		{
			document.all['infolayer'].style.posLeft=x + document.body.scrollLeft - 200;
			document.all['infolayer'].style.posTop=y + document.body.scrollTop - 100;
		}
		else
		{
			if (document.layers)
			{
				document.layers['infolayer'].left = x - 210;
				document.layers['infolayer'].top = y - 100;
			}
			else
			{
				document.getElementById('infolayer').style.left=x + window.scrollX - 200 + "px";
				document.getElementById('infolayer').style.top=y + window.scrollY - 100 +"px";
			}
		}
	}
	else
	{
		if (document.all)
		{
			document.all['infolayer'].style.posLeft=0;
			document.all['infolayer'].style.posTop=-500;
		}
		else
		{
			if (document.layers)
			{
				document.layers['infolayer'].left=0;
				document.layers['infolayer'].top=-500;
			}
			else
			{
				document.getElementById('infolayer').style.left=0;
				document.getElementById('infolayer').style.top=500;
			}
		}
	} 
}
  
function initi(event)
{
	if (document.all)
	{		
		document.onmousemove = move_it;
	}
	else
	{
		if (document.layers) 
		{
			move_it()
		}
		else 
		{
			document.addEventListener("mousemove", ns6, true);
			ns6(event);
		}
	}
}
function ns6(event)
{
	setPos(event.clientX+10,event.clientY+10);
}

function hide()
{ 
	if(document.all) 
	{
	   document.all['infolayer'].style.visibility = 'hidden';
	   document.all['infolayer'].style.posLeft = 0;
	   document.all['infolayer'].style.posTop = -500;
	   visible=false;
	}
	else 
	{  
		if (document.layers)
		{
			document.layers['infolayer'].visibility = 'hide';
			document.layers['infolayer'].left = 0;
			document.layers['infolayer'].top = -500;
			visible=false;
		}
		else
		{			
			document.getElementById('infolayer').style.visibility = 'hidden';
			document.getElementById('infolayer').style.left = 0;
			document.getElementById('infolayer').style.top = -500;
			visible=false;
		}
	}
}

function show(text, header)
{ 
	visible=true;

	
	if ( text != "" )
	{
		text = '<img src="/images/exhibits/'+text+'" width="150">';
	}

	if(document.all)
	{  
		document.all['infolayer'].innerHTML = '<table style="border:1px solid #ffffff;" width="150" cellpadding="0" cellspacing="0" border="0" bgcolor="#FC9200"><tr><td align="center"><span class="w8">'+header+'</span></td></tr><tr><td><table width="150" border="0" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0"><tr><td>'+text+'</td></tr></table></td></tr></table>';
		document.all['infolayer'].style.visibility = 'visible';
	}
	else 
	{
		if (document.layers)
		{
			document.layers['infolayer'].document.open();
			document.layers['infolayer'].document.write('<table style="border:1px solid #ffffff;" width="150" cellpadding="0" cellspacing="0" border="0" bgcolor="#FC9200"><tr><td align="center"><span class="w8">' + header + '</span></td></tr><tr><td><table width="150" border="0" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0"><tr><td>');
			document.layers['infolayer'].document.write(text);
			document.layers['infolayer'].document.write('</td></tr></table></td></tr></table>');
			document.layers['infolayer'].document.close();
			document.layers['infolayer'].visibility = 'show';
		}
		else
		{
		    document.getElementById('infolayer').innerHTML = '<table style="border:1px solid #ffffff;" width="150" cellpadding="0" cellspacing="0" border="0" bgcolor="#FC9200"><tr><td align="center"><span class="w8">' + header + '</span></td></tr><tr><td><table width="150" border="0" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0"><tr><td>' + text + '</td></tr></table></td></tr></table>';			
			document.getElementById('infolayer').style.visibility = 'visible';
		}
	}
} 
